package levels;

import objects.Grass;
import objects.Tile;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.geom.Vector2f;

import divers.StaticVariables;

public class LevelTest extends Level{
	
	private int[] y;
	private String[] side;
	Image fleur;
	
	public void init(GameContainer gc) throws SlickException{
		
		fleur = StaticVariables.sheet.getSprite(3, 0);
		background = new Image("data\\background.png");
		
		y = new int[]{ 10, 9, 8, 8, 8, 8, 8, 9, 10, 10,
				10, 10, 10, 10, 10, 11, 11, 11, 11, 11,
				11, 11, 11, 11, 11, 11};
		
		side = new String[]{ 
				"left", "left", "left", "top", "top", "top", "right", "right", "top", "top",
				"top", "top", "top", "top", "right", "top","top", "top", "top", "top", 
				"top", "top", "top", "top", "top", "top"};
		
		StaticVariables.tiles = new Tile[26];
		
		for (int i = 0; i<StaticVariables.tiles.length; i++){
			
			StaticVariables.tiles[i] = new Grass(side[i], new Vector2f(i, y[i]));
		}
	}
	
	public void render(GameContainer gc, Graphics g){

		background.draw(StaticVariables.cameraposition.x, StaticVariables.cameraposition.y);
		super.render(gc, g);
		fleur.draw(StaticVariables.tiles[1].getX(), StaticVariables.tiles[1].getY()-40, 4);
		fleur.draw(StaticVariables.tiles[4].getX(), StaticVariables.tiles[4].getY()-40, 4);
		fleur.draw(StaticVariables.tiles[12].getX(), StaticVariables.tiles[12].getY()-40, 4);
	}
}
